{extend name='user/public/layout' /}
{block name='content'}
<div class="overflow_h">
    <div class="screen">
        <div class="screen_box01 overflow_h">
            <ul>
                <li><a href="{:url('user.ask/index')}" class="on">提问列表</a></li>
                <li><a href="{:url('user.ask/myanswer')}">回答列表</a></li>
                <li><a href="{:url('user.ask/help')}">求助列表</a></li>
                <li><a href="{:url('user.ask/add')}">我要提问</a></li>
            </ul>
        </div>
    </div>
    <div class="user-nav">
        <table class="tab_list">
            <tr>
                <th style="width: 17%">发布时间</th>
                <th style="width: 10%">所属分类</th>
                <th style="width: 40%">问答标题</th>
                <th style="width: 10%">浏览量</th>
                <th style="width: 10%">状态</th>
                <th style="width: 13%">操作</th>
            </tr>
            {volist name="lists" id='vo' empty='<tr><td>暂无数据</td></tr>'}
            <tr>
                <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                <td>{present name='askCate[$vo.cate_id]'}{$askCate[$vo.cate_id]['name']}{/present}</td>
                <td><a href="{:url('Question/detail',['id'=>$vo['id']])}" target="_blank">{$vo.title}</a></td>
                <td>{$vo.hits}</td>
                <td class="green">
                    {$vo['status']==1?'已审':'<span style="color:#ff0000;">待审</span>'}/
                    {$vo['option']==1?'已解决':'未解决'}</td>
                <td class="dn">
                    {if condition='$vo.answer eq 1'}
                    <a href="{:url('user.ask/detail',['id'=>$vo['id']])}">查看答案</a> |
                    {else /}
                    无回答 |
                    {/if}
                    <a href='javascript:;' data-uri="{:url('user.ask/delete',['id'=>$vo['id']])}" class="J_del">删除</a>
                <td>
            </tr>
            {/volist}
        </table>
        <div class="plastic_bottom_pages">
            {$pages}
        </div>
    </div>
</div>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    $(function(){
        $('.J_del').bind('click',function(){
            if(confirm('您确定要删除所选问题么？')){
                $.get($(this).data('uri'),function(res){
                    if(res.status == 1){
                        layer.msg(res.msg,{icon:1});
                        setTimeout(function(){window.location.reload();},2000);
                    }else{
                        layer.msg(res.msg,{icon:2});
                    }
                });
            }
        });
    });
</script>
{/block}